package iterator;

import java.util.Arrays;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        List<Book> books = Arrays.asList(new Book("基督山"), new Book("白夜行"), new Book("简爱"));
        ConcreteAggregate<Book> aggregate = new ConcreteAggregate<>(books);
        Iterator iterator = aggregate.createIterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
